import request from '@/utils/request'

/**
 * 通知数据获取初始化
 */
export function noticeInit() {
  return request({
    url:  '/merchant_backend/notices',
    method: 'GET'
  })
}

/**
 * 通知数据分页获取
 */
export function noticePageInit(page, date) {
  return request({
    url:  '/merchant_backend/notices',
    method: 'GET',
    params: { page, keyword: date.keyword, publish_at: { start: date.start, end: date.end }}
  })
}

/**
 * 通知详情初始化
 * @param {Number} id 通知id
 */
export function noticeListInit(id) {
  return request({
    url:  '/merchant_backend/notices/' + id,
    method: 'GET'
  })
}

/**
 * 通知查询初始化
 * @param {Number} id 通知id
 */
export function noticeSearchInit(date) {
  return request({
    url:  '/merchant_backend/notices',
    method: 'GET',
    params: { keyword: date.keyword, publish_at: { start: date.start, end: date.end }}
  })
}
